package com.eastcom.dataquality.dv.analysis.extract.impl;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.eastcom.dataquality.core.module.Atom_DataAbnormal;
import com.eastcom.dataquality.core.module.Atom_KpiDefine;
import com.eastcom.dataquality.core.util.ObjectCache;
import com.eastcom.dataquality.dv.CollectData;
import com.eastcom.dataquality.dv.analysis.extract.Extractor;

public class AbnormalData_6_Extractor extends Extractor{

	@Override
	public void process(CollectData collectData) {
		String dataset_id=collectData.getDataset_id();
		Date dataTime=collectData.getDataTime();
		Map valueMap=new HashMap();
		valueMap.put("datasetId", dataset_id);
		List kpis_define=ObjectCache.getObjectsByValueMap(Atom_KpiDefine.class, valueMap);
		int currentDimensionNum=collectData.getKpiDatas().size()/kpis_define.size();
		Atom_DataAbnormal abnormal=new Atom_DataAbnormal();
		abnormal.setDatasetId(dataset_id);
		abnormal.setAbnormalType("6");
		abnormal.setDataTime(new Date());
		abnormal.setDimensionNum(currentDimensionNum);
		abnormal.setTimeStamp(dataTime);
		daoFactory.getAbnormalDao().insert(abnormal);
	}
}
